package com.example.medical.controller.list;

import com.example.medical.service.*;
import com.example.medical.utils.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/list/api")
public class ListApi {

    @Autowired
    private DeviceService deviceService;
    @Autowired
    private DeviceTypeService deviceTypeService;
    @Autowired
    private DivisionService divisionService;
    @Autowired
    private NoticeTypeService noticeTypeService;
    @Autowired
    private SectorService sectorService;
    @Autowired
    private StoreroomService storeroomService;
    @Autowired
    private StoreroomTypeService storeroomTypeService;
    @Autowired
    private UserService userService;
    @Autowired
    private LogingService logingService;

    @GetMapping("/device_api")
    public Result DeviceApi(){
        return Result.okResult(deviceService.list());
    }

    @GetMapping("/device_type_api")
    public Result DeviceTypeApi(){
        return Result.okResult(deviceTypeService.list());
    }

    @GetMapping("division_api")
    public Result DivisionApi(){
        return Result.okResult(divisionService.list());
    }

    @GetMapping("/notice_type_api")
    public Result NoticeTypeApi(){
        return Result.okResult(noticeTypeService.list());
    }

    @GetMapping("/sector_api")
    public Result SectorApi(){
        return Result.okResult(sectorService.list());
    }

    @GetMapping("/storeroom_api")
    public Result StoreroomApi(){
        return Result.okResult(storeroomService.list());
    }

    @GetMapping("/storeroom_type_api")
    public Result StoreroomTypeApi(){
        return Result.okResult(storeroomTypeService.list());
    }

    @GetMapping("/user_api")
    public Result UserApi(){return Result.okResult(userService.list());}

    @GetMapping("/loging_api")
    public Result LogingApi(){return Result.okResult(logingService.list());}

}
